package com.zozo.guanli.web;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;

import com.zozo.guanli.util.SystemContext;

public class ZozoListener implements ServletContextListener {

    protected static final Logger logger = Logger.getLogger(ZozoListener.class);
    private ServletContext context = null;

    @Override
    public void contextDestroyed(ServletContextEvent event) {
        this.context = null;
    }

    @Override
    public void contextInitialized(ServletContextEvent event) {
        this.context = event.getServletContext();
        String realPath = context.getRealPath("/");
        SystemContext.setProperty("AppContextPath", realPath);

    }

}
